package parser_antlr4.aspect;

import utils.StringSQLUtils;

import java.lang.reflect.Method;

public class ParserAspectSQLClean implements ParserAspect {

    @Override
    public boolean enabled() {
        return true;
    }

    @Override
    public void beforeParse(Method method, Object[] args) {
        for (int i = 0; i < args.length; i++) {
            if (args[i] instanceof String) {
                args[i] = StringSQLUtils.cleanSQLNote((String) args[i]);
            }
        }
    }
}
